import request from '@/utils/request'

// 封装获取角色信息的请求

export const reqGetRoleList = (page, pagesize) => {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}

// 新增角色
export const reqAddRole = (data) => {
  return request({
    url: '/sys/role',
    data,
    method: 'post'
  })
}

// 修改角色并更新接口
export const reqUpdateRole = (data) => {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

// 根据id获取角色的请求

export const reqGetRoleDetail = (id) => {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}
